#ifndef CORE_WINDOW_H
#define CORE_WINDOW_H

#include "Common/Algebra/Transform.h"
#include "Drawing/IDrawer.h"
#include "Input/EventArgs/KeyEventArgs.h"
#include "Input/EventArgs/MouseButtonEventArgs.h"
#include "Input/EventArgs/MouseMoveEventArgs.h"
#include "Input/EventArgs/MouseScrollEventArgs.h"

#include "GameCore/Size.h"
#include "GameCore/Point.h"
#include "GameCore/WindowMode.h"

namespace core {

	class Window
	{
	protected:
		Window( const Point& position, const Size& size, const char* title, WindowMode mode );

	public:
		virtual ~Window();

		Point GetPosition() const;
		void SetPosition( const Point& pos );

		Size GetSize() const;
		void SetSize( const Size& size );

		const char* GetTitle() const;
		void SetTitle( const char* title );

		WindowMode GetMode() const;
		void SetMode( WindowMode mode );

		bool IsOpened() const;
		bool IsActive() const;
		bool IsIconified() const;

		void Draw();

		void PollEvents();
		void Iconify();
		void Restore();

		void Resized( const Size& size );
		void Closed();
		void Refreshed();

        virtual void KeyPressed( const input::KeyEventArgs& eventArgs ) = 0;
        virtual void KeyReleased( const input::KeyEventArgs& eventArgs ) = 0;

        virtual void MouseButtonPressed( const input::MouseButtonEventArgs& eventArgs ) = 0;
        virtual void MouseButtonReleased( const input::MouseButtonEventArgs& eventArgs ) = 0;

        virtual void MouseMoved( const input::MouseMoveEventArgs& eventArgs ) = 0;
        virtual void MouseScrolled( const input::MouseScrollEventArgs& eventArgs ) = 0;

	protected:
		virtual cmn::Transform GetCamera() = 0;
		virtual void DrawInner( drawing::IDrawer& drawer ) = 0;

		virtual void ResizedInner( const Size& size ) = 0;
		virtual void ClosedInner() = 0;
		virtual void RefreshedInner() = 0;

	private:
		const char* m_title;
		Point m_position;
		WindowMode m_mode;
	};
}
#endif
